package com.swak.metrics.metas;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * 关注的执行的统计情况<br>
 * 速率和用时 :例如方法的执行统计<br>
 * 
 * Timer.Context context = timer.time();<br>
 * do Something <br>
 * context.stop();<br>
 * 
 * 数量： "count":"10",<br>
 * 
 * 最大、最小、平均，方差（用时 MS） ：<br>
 * "max":1947.8523,<br>
 * "mean":1225.402374631002,<br>
 * "stddev":583.1300369403967, <br>
 * "min":383.8867,<br>
 * 
 * 用时统计分析（MS）：<br>
 * "p50":1612.8075, 50% 的 用时1612.8075<br>
 * "p75":1716.1978,<br>
 * "p95":1947.8523,<br>
 * "p98":1947.8523,<br>
 * "p99":1947.8523,<br>
 * "p999":1947.8523,<br>
 * 
 * 速率（QPS） calls/s ： <br>
 * "m1_rate":0.8, 1分钟内 8次调用每秒<br>
 * "m5_rate":0.8<br>
 * "m15_rate":0.8,<br>
 * "mean_rate":0.8198866121412007, <br>
 */
@Getter
@Setter
@Accessors(chain = true)
@ToString(callSuper = true)
public class TimerMeta extends ServerMeta {
	private String type = "TIMER";
	private String name;
	private Long count;
	private Double min;
	private Double max;
	private Double mean;
	private Double stddev;
	private Double p50;
	private Double p75;
	private Double p95;
	private Double p98;
	private Double p99;
	private Double p999;
	private Double m1_rate;
	private Double m5_rate;
	private Double m15_rate;
	private Double mean_rate;
	private String rate_unit;
	private String duration_unit;
}
